<?php
/**
 * Created by PhpStorm.
 * User: mac
 * Date: 19/12/19
 * Time: 21:22
 */

namespace app\admin\controller;


use app\common\bean\ListMap;
use app\common\bean\UserImageBean;
use app\common\controller\AdminController;
use app\common\manage\UserImageManage;
use app\common\utils\ExitJsonUtil;

class UserImage extends AdminController
{

    /**
     * 用户图片列表
     * @throws \Exception
     */
    public function userImageList(){
        $listMap = new ListMap();
        $listMap->setData($this->getParams);
        $userImageMap = UserImageManage::getInstance()->getPaginatorList($listMap);
        $this->assign("userImageList",$userImageMap->getList());
        $this->assign("currentPage",$userImageMap->getCurrentPage());
        $this->assign("totalCount",$userImageMap->getTotalCount());
        return $this->fetch();
    }

    /**
     * 删除用户图片
     * @throws \Exception
     */
    public function deleteUserImage(){
        $userImageBean = new UserImageBean();
        $userImageBean->setData($this->getParams);
        $result = UserImageManage::getInstance()->delete($userImageBean);
        ExitJsonUtil::getInstance()->exitData($result);
    }
}